fix: add usage tracking to config method #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tracking internally in SDK-1414.
Add usage tracking to config method
This PR implements SDK spec requirement 1.2.3.5 by adding usage tracking to the
config
method across all AI SDK repositories, following the pattern established in JS Core PR #904.Requirements
Related issues
Describe the solution you've provided
Added a single tracking call
track('$ld:ai:config:function:single', context, key, 1)
at the beginning of eachconfig
method across all 4 AI SDK repositories:@ld_client.track('$ld:ai:config:function:single', context, config_key, 1)
self._client.track('$ld:ai:config:function:single', context, key, 1)
c.sdk.TrackMetric("$ld:ai:config:function:single", context, 1, ldvalue.String(key))
_client.Track("$ld:ai:config:function:single", context, LdValue.Of(key), 1)
Each implementation includes a corresponding unit test to verify the tracking call is made with the correct parameters.
Critical Review Points
🔍 Key Items to Review:
$ld:ai:config:function:single
is exactly as specifiedDescribe alternatives you've considered
Additional context
Cross-SDK Implementation Details
track(event, context, key, value)
track(event, context, key, value)
TrackMetric(event, context, value, data)
Track(event, context, data, value)